<!doctype html>



  


<html class="theme-next mist use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>



<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />












  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.0" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="osgi,karaf,maven," />








  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.1.0" />






<meta name="description" content="概述在使用Apache Karaf进行实际打包发布时，基于Maven的自动依赖环境可能会制约产品的打包发布。因为出于安全要求，要部署运行的环境往往不能随意访问远程的Maven仓库，这时就需要将产品运行所需要的所有Feature及Bundle等进行离线打包。
Karaf对OSGi Bundle的组织采用Pax的 maven url 方式，这也隐性的继承了maven的特性，即，所有的依赖来自maven">
<meta property="og:type" content="article">
<meta property="og:title" content="Apache Karaf构建动态模块化应用(6)--Karaf离线打包发布">
<meta property="og:url" content="http://chrisrc.me/2015/08/04/java-osgi-dynamic-app-with-karaf-deploy/index.html">
<meta property="og:site_name" content="山中，山外与俯瞰">
<meta property="og:description" content="概述在使用Apache Karaf进行实际打包发布时，基于Maven的自动依赖环境可能会制约产品的打包发布。因为出于安全要求，要部署运行的环境往往不能随意访问远程的Maven仓库，这时就需要将产品运行所需要的所有Feature及Bundle等进行离线打包。
Karaf对OSGi Bundle的组织采用Pax的 maven url 方式，这也隐性的继承了maven的特性，即，所有的依赖来自maven">
<meta property="og:updated_time" content="2016-12-17T04:03:28.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Apache Karaf构建动态模块化应用(6)--Karaf离线打包发布">
<meta name="twitter:description" content="概述在使用Apache Karaf进行实际打包发布时，基于Maven的自动依赖环境可能会制约产品的打包发布。因为出于安全要求，要部署运行的环境往往不能随意访问远程的Maven仓库，这时就需要将产品运行所需要的所有Feature及Bundle等进行离线打包。
Karaf对OSGi Bundle的组织采用Pax的 maven url 方式，这也隐性的继承了maven的特性，即，所有的依赖来自maven">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Mist',
    sidebar: {"position":"left","display":"post"},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://chrisrc.me/2015/08/04/java-osgi-dynamic-app-with-karaf-deploy/"/>





  <title> Apache Karaf构建动态模块化应用(6)--Karaf离线打包发布 | 山中，山外与俯瞰 </title>
</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  










  
  
    
  

  <div class="container one-collumn sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-meta ">
  

  <div class="custom-logo-site-title">
    <a href="/"  class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <span class="site-title">山中，山外与俯瞰</span>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>
  <p class="site-subtitle">一次永不停止的探索之旅</p>
</div>

<div class="site-nav-toggle">
  <button>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
  </button>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-dcos">
          <a href="/dcos" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-book"></i> <br />
            
            DC/OS
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      

      
        <li class="menu-item menu-item-search">
          
            <a href="javascript:;" class="st-search-show-outputs">
          
            
              <i class="menu-item-icon fa fa-search fa-fw"></i> <br />
            
            搜索
          </a>
        </li>
      
    </ul>
  

  
    <div class="site-search">
      
  <form class="site-search-form">
  <input type="text" id="st-search-input" class="st-search-input st-default-search-input" />
</form>

<script type="text/javascript">
  (function(w,d,t,u,n,s,e){w['SwiftypeObject']=n;w[n]=w[n]||function(){
    (w[n].q=w[n].q||[]).push(arguments);};s=d.createElement(t);
    e=d.getElementsByTagName(t)[0];s.async=1;s.src=u;e.parentNode.insertBefore(s,e);
  })(window,document,'script','//s.swiftypecdn.com/install/v2/st.js','_st');

  _st('install', 'R9GcmhBwxpsAGLNCsquZ','2.0.0');
</script>



    </div>
  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
  <link itemprop="mainEntityOfPage" href="http://chrisrc.me/2015/08/04/java-osgi-dynamic-app-with-karaf-deploy/">

  <span style="display:none" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <meta itemprop="name" content="chrisrc">
    <meta itemprop="description" content="">
    <meta itemprop="image" content="/images/avatar.gif">
  </span>

  <span style="display:none" itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
    <meta itemprop="name" content="山中，山外与俯瞰">
    <span style="display:none" itemprop="logo" itemscope itemtype="http://schema.org/ImageObject">
      <img style="display:none;" itemprop="url image" alt="山中，山外与俯瞰" src="">
    </span>
  </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
            
            
              
                Apache Karaf构建动态模块化应用(6)--Karaf离线打包发布
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>
              <time title="Post created" itemprop="dateCreated datePublished" datetime="2015-08-04T12:15:45+08:00">
                2015-08-04
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
              <span class="post-meta-divider">|</span>
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/OSGi/" itemprop="url" rel="index">
                    <span itemprop="name">OSGi</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
              <span class="post-comments-count">
                <span class="post-meta-divider">|</span>
                <a href="/2015/08/04/java-osgi-dynamic-app-with-karaf-deploy/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count ds-thread-count" data-thread-key="2015/08/04/java-osgi-dynamic-app-with-karaf-deploy/" itemprop="commentCount"></span>
                </a>
              </span>
            
          

          

          
          

          

          

        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        <h2 id="概述"><a href="#概述" class="headerlink" title="概述"></a>概述</h2><p>在使用Apache Karaf进行实际打包发布时，基于Maven的自动依赖环境可能会制约产品的打包发布。因为出于安全要求，要部署运行的环境往往不能<br>随意访问远程的Maven仓库，这时就需要将产品运行所需要的所有Feature及Bundle等进行离线打包。</p>
<p>Karaf对OSGi Bundle的组织采用Pax的 <strong>maven url</strong> 方式，这也隐性的继承了maven的特性，即，所有的依赖来自maven仓库，<br>在实际开发中，这大大的便利了项目结构的组织和维护，开发人员只要指明对某个bundle的maven依赖，karaf自动去选取和下载。</p>
<p>本文对之前写的一篇博客进行了简单整理，作为本系列的一部分。</p>
<h2 id="Pax-URL-Mvn协议"><a href="#Pax-URL-Mvn协议" class="headerlink" title="Pax URL Mvn协议"></a>Pax URL Mvn协议</h2><p>在讨论karaf的maven依赖加载与管理之前，我们先了解一下<a href="https://ops4j1.jira.com/wiki/display/paxurl/Mvn+Protocol" target="_blank" rel="external">Pax URL</a>项目的Mvn协议：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div></pre></td><td class="code"><pre><div class="line">mvn-uri := &apos;mvn:&apos; [ repository-url &apos;!&apos; ] group-id &apos;/&apos; artifact-id [ &apos;/&apos; [version] [ &apos;/&apos; [type] [ &apos;/&apos; classifier ] ] ] ]  </div><div class="line">repository-url := &lt; rfc2396 uri &gt; ; an url that points to a maven 2 repository</div><div class="line">group-id := &lt; maven groupId &gt; ; group id of maven artifact</div><div class="line">artifact-id := &lt; maven artifactId &gt; ; artifact id of maven artifact</div><div class="line">version := &lt; maven version &gt; | &apos;LATEST&apos; | range ; version of maven artifact</div><div class="line">range := ( &apos;[&apos; | &apos;(&apos; ) version &apos;,&apos; version ( &apos;)&apos; | &apos;]&apos; )</div><div class="line">type := &lt; maven type&gt; ; type of maven artifact</div><div class="line">classifier := &lt; maven classifier&gt; ; maven artifact classifier</div></pre></td></tr></table></figure>
<p>假设项目需要依赖Pax Web的service-0.2.0-SNAPSHOT.jar,对应的Mvn协议示例如下：</p>
<ul>
<li>mvn:org.ops4j.pax.web.bundles/service</li>
<li>mvn:org.ops4j.pax.web.bundles/service/LATEST</li>
<li>mvn:org.ops4j.pax.web.bundles/service/0.2.0-SNAPSHOT</li>
<li>mvn:<a href="http://repository.ops4j.org/maven2!org.ops4j.pax.web.bundles/service/0.2.0" target="_blank" rel="external">http://repository.ops4j.org/maven2!org.ops4j.pax.web.bundles/service/0.2.0</a></li>
<li>mvn:file://c:/localRepo!org.ops4j.pax.web.bundles/service/0.2.0  # 从目录中加载</li>
<li>mvn:org.ops4j.pax.web/pax-web-features/3.0.4-SNAPSHOT/xml/features # 标识pax-web-features-3.0.4-SNAPSHOT-features.xml构件</li>
</ul>
<h3 id="协议要点"><a href="#协议要点" class="headerlink" title="协议要点"></a>协议要点</h3><ol>
<li>如果版本（version）未指定，将使用默认值“LATEST”，并从可用的Maven元数据（metadata）中解析最新的版本，maven metadata的示例如下：</li>
</ol>
<figure class="highlight xml"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div></pre></td><td class="code"><pre><div class="line">&lt;?xml version="1.0" encoding="UTF-8"?&gt;  </div><div class="line"><span class="tag">&lt;<span class="name">metadata</span> <span class="attr">modelVersion</span>=<span class="string">"1.1.0"</span>&gt;</span>  </div><div class="line">  <span class="tag">&lt;<span class="name">groupId</span>&gt;</span>org.ops4j.pax.web<span class="tag">&lt;/<span class="name">groupId</span>&gt;</span>  </div><div class="line">  <span class="tag">&lt;<span class="name">artifactId</span>&gt;</span>pax-web-features<span class="tag">&lt;/<span class="name">artifactId</span>&gt;</span>  </div><div class="line">  <span class="tag">&lt;<span class="name">version</span>&gt;</span>3.0.4-SNAPSHOT<span class="tag">&lt;/<span class="name">version</span>&gt;</span>  </div><div class="line">  <span class="tag">&lt;<span class="name">versioning</span>&gt;</span>  </div><div class="line">    <span class="tag">&lt;<span class="name">snapshot</span>&gt;</span>  </div><div class="line">      <span class="tag">&lt;<span class="name">timestamp</span>&gt;</span>20131113.170334<span class="tag">&lt;/<span class="name">timestamp</span>&gt;</span>  </div><div class="line">      <span class="tag">&lt;<span class="name">buildNumber</span>&gt;</span>2<span class="tag">&lt;/<span class="name">buildNumber</span>&gt;</span>  </div><div class="line">    <span class="tag">&lt;/<span class="name">snapshot</span>&gt;</span>  </div><div class="line">    <span class="tag">&lt;<span class="name">lastUpdated</span>&gt;</span>20131113170334<span class="tag">&lt;/<span class="name">lastUpdated</span>&gt;</span>  </div><div class="line">    <span class="tag">&lt;<span class="name">snapshotVersions</span>&gt;</span>  </div><div class="line">      <span class="tag">&lt;<span class="name">snapshotVersion</span>&gt;</span>  </div><div class="line">        <span class="tag">&lt;<span class="name">extension</span>&gt;</span>pom<span class="tag">&lt;/<span class="name">extension</span>&gt;</span>  </div><div class="line">        <span class="tag">&lt;<span class="name">value</span>&gt;</span>3.0.4-20131113.170334-2<span class="tag">&lt;/<span class="name">value</span>&gt;</span>  </div><div class="line">        <span class="tag">&lt;<span class="name">updated</span>&gt;</span>20131113170334<span class="tag">&lt;/<span class="name">updated</span>&gt;</span>  </div><div class="line">      <span class="tag">&lt;/<span class="name">snapshotVersion</span>&gt;</span>  </div><div class="line">      <span class="tag">&lt;<span class="name">snapshotVersion</span>&gt;</span>  </div><div class="line">        <span class="tag">&lt;<span class="name">classifier</span>&gt;</span>features<span class="tag">&lt;/<span class="name">classifier</span>&gt;</span>  </div><div class="line">        <span class="tag">&lt;<span class="name">extension</span>&gt;</span>xml<span class="tag">&lt;/<span class="name">extension</span>&gt;</span>  </div><div class="line">        <span class="tag">&lt;<span class="name">value</span>&gt;</span>3.0.4-20131113.170334-2<span class="tag">&lt;/<span class="name">value</span>&gt;</span>  </div><div class="line">        <span class="tag">&lt;<span class="name">updated</span>&gt;</span>20131113170334<span class="tag">&lt;/<span class="name">updated</span>&gt;</span>  </div><div class="line">      <span class="tag">&lt;/<span class="name">snapshotVersion</span>&gt;</span></div><div class="line">    <span class="tag">&lt;/<span class="name">snapshotVersions</span>&gt;</span>  </div><div class="line">  <span class="tag">&lt;/<span class="name">versioning</span>&gt;</span>  </div><div class="line"><span class="tag">&lt;/<span class="name">metadata</span>&gt;</span></div></pre></td></tr></table></figure>
<ol>
<li><p>如果version是SNAPSHOT版本，则采用与maven一致的策略来解析SNAPSHOT版本；</p>
</li>
<li><p>如果type未指定，默认值为JAR；</p>
</li>
<li><p>如果指定了一个type但没有指定version，则必须为version留有占位即：mvn:groups/artifact//type</p>
</li>
<li><p>Pax URL从0.3.0版本开始支持类别Classifier，如果类别classifier未指定，则不启用类别；</p>
</li>
<li><p>如果指定了类别，但没有指定版本version或类型type，则必须未版本和（或）类型留有占位，即：</p>
</li>
</ol>
<blockquote>
<p>mvn:groups/artifact///classifier</p>
</blockquote>
<p> 或</p>
<blockquote>
<p>mvn:groups/artifact/version//classifier</p>
</blockquote>
<p> 或</p>
<blockquote>
<p>mvn:groups/artifact//type/classifier</p>
</blockquote>
<h3 id="版本范围"><a href="#版本范围" class="headerlink" title="版本范围"></a>版本范围</h3><p>从0.2.0版本开始，Pax URL Mvn支持版本范围，示例如下</p>
<pre><code>- [1.2.3, 4.5.6) — 1.2.3 &lt;= x &lt; 4.5.6
- [1.2.3, 4.5.6] — 1.2.3 &lt;= x &lt;= 4.5.6
- (1.2.3, 4.5.6) — 1.2.3 &lt; x &lt; 4.5.6
- (1.2.3, 4.5.6] — 1.2.3 &lt; x &lt;= 4.5.6
</code></pre><h3 id="mvn协议的参数配置"><a href="#mvn协议的参数配置" class="headerlink" title="mvn协议的参数配置"></a>mvn协议的参数配置</h3><p>可以通过两种方式来配置Mvn协议：1）通过OSGi CM；2）通过框架/系统变量。通过CM配置的参数具有高优先级。</p>
<table>
<thead>
<tr>
<th style="text-align:left">参数名称</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"></td>
</tr>
</tbody>
</table>
<p>org.ops4j.pax.url.mvn.certificateCheck| optional; true/false if the SSL certificate check should be done. Default false.<br>org.ops4j.pax.url.mvn.globalUpdatePolicy| optional; 控制远程maven仓库的更新策略，maven通过本地POM的时间戳比对为依据。可选的策略包括：always, daily (default), interval:X (where X is an integer in minutes) or never.<br>org.ops4j.pax.url.mvn.localRepository| optional; 指向本地仓库目录的路径<br>org.ops4j.pax.url.mvn.repositories| optional; 以逗号分隔的仓库URL列表<br>org.ops4j.pax.url.mvn.defaultRepositories| optional; 以逗号分隔的默认仓库URL列表<br>org.ops4j.pax.url.mvn.settings| optional; 指向maven settings.xml的路径<br>org.ops4j.pax.url.mvn.proxySupport| optional; true/false if the proxy support is enabled . Default true.  </p>
<h3 id="Maven-Settings配置查找"><a href="#Maven-Settings配置查找" class="headerlink" title="Maven Settings配置查找"></a>Maven Settings配置查找</h3><p>如果有必要且maven settings.xml可用，Pax URL Mvn按如下步骤查找settings.xml：</p>
<ol>
<li>查找配置参数</li>
<li>如果未找到，查找 ${user.home}/.m2/settings.xml</li>
<li>如果未找到，查找 ${maven.home}/conf/settings.xml</li>
<li>如果未找到，查找 ${M2_HOME}/conf/settings.xml</li>
</ol>
<h3 id="Maven本地仓库的查找"><a href="#Maven本地仓库的查找" class="headerlink" title="Maven本地仓库的查找"></a>Maven本地仓库的查找</h3><p>Maven本地仓库的查找顺序如下：</p>
<ol>
<li>查找配置参数定义；</li>
<li>如果未找到，在settings.xml中进行查找</li>
<li>如果未找到，默认认为仓库位于${user.home}/.m2/repository.</li>
</ol>
<h3 id="远端Maven仓库的解析"><a href="#远端Maven仓库的解析" class="headerlink" title="远端Maven仓库的解析"></a>远端Maven仓库的解析</h3><p>Maven仓库的解析顺序如下:</p>
<ol>
<li>在配置参数中查找</li>
<li>在settings.xml中查找</li>
</ol>
<p>如果配置参数中 <strong>org.ops4j.pax.url.mvn.repositories</strong> 的值以’+’开始，则来自settings.xml中的仓库地址也将附加到此配置的仓库列表中。</p>
<h3 id="设定仓库包含release-snapshot"><a href="#设定仓库包含release-snapshot" class="headerlink" title="设定仓库包含release/snapshot"></a>设定仓库包含release/snapshot</h3><p>可以在参数配置的仓库URL中通过添加如下标识来指定仓库所含有的构件类型（不区分大小写）：</p>
<pre><code>启用snapshots — 添加 @snapshots
禁用releases — 添加 @noreleases
</code></pre><p>示例如下:</p>
<ul>
<li><a href="http://repository.ops4j.org" target="_blank" rel="external">http://repository.ops4j.org</a> ; 默认不包含任何标识，只查找releases, 不包括snapshots  </li>
<li><a href="http://repository.ops4j.org/mvn-snapshots@snapshots" target="_blank" rel="external">http://repository.ops4j.org/mvn-snapshots@snapshots</a> ; 同时在此仓库查找releases和snapshots  </li>
<li><a href="http://repository.ops4j.org/mvn-snapshots@snapshots@noreleases" target="_blank" rel="external">http://repository.ops4j.org/mvn-snapshots@snapshots@noreleases</a> ; 仅查找snapshots, 不查找releases  </li>
</ul>
<h3 id="默认仓库"><a href="#默认仓库" class="headerlink" title="默认仓库"></a>默认仓库</h3><p>在某些情况下，通过默认仓库配置，可以防止用户配置对下载构件造成影响。如果对 <strong>org.ops4j.pax.url.mvn.defaultRepositories</strong> 进行了设置，则Pax URL Mvn首先检查此参数设定的默认仓库列表，如果未找到，则继续查找本地仓库和其它在 <strong>org.ops4j.pax.url.mvn.repositories</strong> 中配置的仓库。</p>
<h2 id="Karaf中Maven仓库处理策略的配置"><a href="#Karaf中Maven仓库处理策略的配置" class="headerlink" title="Karaf中Maven仓库处理策略的配置"></a>Karaf中Maven仓库处理策略的配置</h2><h3 id="默认仓库处理策略"><a href="#默认仓库处理策略" class="headerlink" title="默认仓库处理策略"></a>默认仓库处理策略</h3><p>Karaf通过 <strong>OSGi CM（config admin）</strong> 服务对Pax URL Mvn协议处理进行参数配置，具体的配置是位于<code>${karaf.home}/etc</code>下的<br><code>org.ops4j.pax.url.mvn.cfg</code>文件：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div></pre></td><td class="code"><pre><div class="line">#org.ops4j.pax.url.mvn.certificateCheck=</div><div class="line"></div><div class="line">#org.ops4j.pax.url.mvn.settings=</div><div class="line"></div><div class="line">#org.ops4j.pax.url.mvn.localRepository=</div><div class="line"></div><div class="line">org.ops4j.pax.url.mvn.useFallbackRepositories=false</div><div class="line"></div><div class="line"># org.ops4j.pax.url.mvn.proxySupport=false</div><div class="line"></div><div class="line">org.ops4j.pax.url.mvn.defaultRepositories=\</div><div class="line">    file:$&#123;karaf.home&#125;/$&#123;karaf.default.repository&#125;@id=system.repository@snapshots, \</div><div class="line">    file:$&#123;karaf.data&#125;/kar@id=kar.repository@multi@snapshots, \</div><div class="line">    file:$&#123;karaf.base&#125;/$&#123;karaf.default.repository&#125;@id=child.system.repository@snapshots</div><div class="line"></div><div class="line"># Use the default local repo (e.g.~/.m2/repository) as a &quot;remote&quot; repo</div><div class="line">#org.ops4j.pax.url.mvn.defaultLocalRepoAsRemote=false</div><div class="line"></div><div class="line">org.ops4j.pax.url.mvn.repositories= \</div><div class="line">    http://repo1.maven.org/maven2@id=central, \</div><div class="line">    http://repository.springsource.com/maven/bundles/release@id=spring.ebr.release, \</div><div class="line">    http://repository.springsource.com/maven/bundles/external@id=spring.ebr.external, \</div><div class="line">    http://zodiac.springsource.com/maven/bundles/release@id=gemini, \</div><div class="line">    http://repository.apache.org/content/groups/snapshots-group@id=apache@snapshots@noreleases, \</div><div class="line">    https://oss.sonatype.org/content/repositories/snapshots@id=sonatype.snapshots.deploy@snapshots@noreleases, \</div><div class="line">    https://oss.sonatype.org/content/repositories/ops4j-snapshots@id=ops4j.sonatype.snapshots.deploy@snapshots@noreleases, \</div><div class="line">    http://repository.springsource.com/maven/bundles/external@id=spring-ebr-repository@snapshots@noreleases</div></pre></td></tr></table></figure>
<p><strong>下面我们来看一下如何通过调整此配置文件，使得Karaf不再依赖远程Maven仓库和本地Maven仓库，让Karaf发布包随意离线部署成为现实。</strong></p>
<p>首先我们来看一下在org.ops4j.pax.url.mvn.repositories配置中存在两个指向目录路径的仓库URL，即：</p>
<blockquote>
<p><code>file:${karaf.home}/${karaf.default.repository}@id=system.repository</code></p>
</blockquote>
<p> 和</p>
<blockquote>
<p><code>file:${karaf.data}/kar@id=kar.repository@multi。file:${karaf.home}/${karaf.default.repository}@id=system.repository</code></p>
</blockquote>
<p> 实际指向的是karaf安装目录下的 <strong>system目录</strong>（也可以根据需要自行调整，<code>karaf.default.repository</code>参数位于 <strong>etc/system.properties</strong> 文件中）；</p>
<p> <code>file:${karaf.data}/kar@id=kar.repository@multi</code>实际指向的是karaf安装目录下的 <strong>data/kar</strong> 目录。</p>
<h3 id="离线处理策略"><a href="#离线处理策略" class="headerlink" title="离线处理策略"></a>离线处理策略</h3><p>通过禁用其他仓库URL，只启用这两个位置仓库，则karaf发布程序即可实现离线部署。</p>
<p>上面的<code>org.ops4j.pax.url.mvn.cfg</code>文件按下面具体配置进行调整：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div></pre></td><td class="code"><pre><div class="line">org.ops4j.pax.url.mvn.settings=</div><div class="line">org.ops4j.pax.url.mvn.localRepository=file:$&#123;karaf.home&#125;/$&#123;karaf.default.repository&#125;@id=system.repository@snapshots</div><div class="line">org.ops4j.pax.url.mvn.defaultLocalRepoAsRemote=true</div><div class="line">org.ops4j.pax.url.mvn.repositories= \  </div><div class="line">    file:$&#123;karaf.home&#125;/$&#123;karaf.default.repository&#125;@id=system.repository@snapshots, \  </div><div class="line">    file:$&#123;karaf.data&#125;/kar@id=kar.repository@multi</div></pre></td></tr></table></figure></p>
<p>此模式下，Pax URL Mvn优先检查system仓库，如果不存在，则检查${user.home}/.m2下的配置，如果没有settings.xml和repository目录，则加载依赖失败。</p>
<p>在实际部署时，确保system仓库包含所有依赖的bundle即可。</p>
<p>通过此方案，如果发布包中的system目录包含了系统运行所需的所有依赖，则karaf将不再寻求从远程仓库加载依赖，从而实现离线部署。</p>
<h3 id="离线依赖自动打包"><a href="#离线依赖自动打包" class="headerlink" title="离线依赖自动打包"></a>离线依赖自动打包</h3><p><strong>通过上述方案实现karaf离线部署的同时产生了新的问题，如何确保system目录包含所有的依赖同时又不包含无用的冗余依赖？</strong></p>
<p>这个问题可以通过karaf-maven-plugin提供的 <strong>features-add-to-repository</strong> 目标获得解决。在打包部署时，系统自动将Feature里的Bundle打包到system目录下。<br>下面来看一下配置：<br><figure class="highlight xml"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div><div class="line">31</div><div class="line">32</div><div class="line">33</div><div class="line">34</div><div class="line">35</div><div class="line">36</div><div class="line">37</div><div class="line">38</div><div class="line">39</div></pre></td><td class="code"><pre><div class="line"><span class="tag">&lt;<span class="name">plugin</span>&gt;</span>  </div><div class="line">  <span class="tag">&lt;<span class="name">groupId</span>&gt;</span>org.apache.karaf.tooling<span class="tag">&lt;/<span class="name">groupId</span>&gt;</span>  </div><div class="line">  <span class="tag">&lt;<span class="name">artifactId</span>&gt;</span>karaf-maven-plugin<span class="tag">&lt;/<span class="name">artifactId</span>&gt;</span>  </div><div class="line">  <span class="tag">&lt;<span class="name">executions</span>&gt;</span>  </div><div class="line">      <span class="tag">&lt;<span class="name">execution</span>&gt;</span>  </div><div class="line">          <span class="tag">&lt;<span class="name">id</span>&gt;</span>install-kar<span class="tag">&lt;/<span class="name">id</span>&gt;</span>  </div><div class="line">          <span class="tag">&lt;<span class="name">phase</span>&gt;</span>compile<span class="tag">&lt;/<span class="name">phase</span>&gt;</span>  </div><div class="line">          <span class="tag">&lt;<span class="name">goals</span>&gt;</span>  </div><div class="line">            <span class="tag">&lt;<span class="name">goal</span>&gt;</span>install-kars<span class="tag">&lt;/<span class="name">goal</span>&gt;</span>  </div><div class="line">          <span class="tag">&lt;/<span class="name">goals</span>&gt;</span>  </div><div class="line">      <span class="tag">&lt;/<span class="name">execution</span>&gt;</span>  </div><div class="line">      <span class="tag">&lt;<span class="name">execution</span>&gt;</span>  </div><div class="line">          <span class="tag">&lt;<span class="name">id</span>&gt;</span>features-add-to-repo<span class="tag">&lt;/<span class="name">id</span>&gt;</span>  </div><div class="line">          <span class="tag">&lt;<span class="name">phase</span>&gt;</span>generate-resources<span class="tag">&lt;/<span class="name">phase</span>&gt;</span>  </div><div class="line">          <span class="tag">&lt;<span class="name">goals</span>&gt;</span>  </div><div class="line">              features-add-to-repository</div><div class="line">          <span class="tag">&lt;/<span class="name">goals</span>&gt;</span>  </div><div class="line">          <span class="tag">&lt;<span class="name">configuration</span>&gt;</span>  </div><div class="line">              <span class="tag">&lt;<span class="name">descriptors</span>&gt;</span>  </div><div class="line">                  <span class="tag">&lt;<span class="name">descriptor</span>&gt;</span>mvn:org.apache.karaf.features/standard/$&#123;karaf.version&#125;/xml/features<span class="tag">&lt;/<span class="name">descriptor</span>&gt;</span>  </div><div class="line">                  <span class="tag">&lt;<span class="name">descriptor</span>&gt;</span>mvn:org.apache.karaf.features/spring/$&#123;karaf.version&#125;/xml/features<span class="tag">&lt;/<span class="name">descriptor</span>&gt;</span></div><div class="line">                  ……</div><div class="line">              <span class="tag">&lt;/<span class="name">descriptors</span>&gt;</span>  </div><div class="line">              <span class="tag">&lt;<span class="name">features</span>&gt;</span>  </div><div class="line">                  <span class="tag">&lt;<span class="name">feature</span>&gt;</span>http<span class="tag">&lt;/<span class="name">feature</span>&gt;</span></div><div class="line">                  <span class="tag">&lt;<span class="name">feature</span>&gt;</span>spring<span class="tag">&lt;/<span class="name">feature</span>&gt;</span></div><div class="line">                  …  </div><div class="line">              <span class="tag">&lt;/<span class="name">features</span>&gt;</span>  </div><div class="line">              <span class="tag">&lt;<span class="name">repository</span>&gt;</span>target/assembly/system<span class="tag">&lt;/<span class="name">repository</span>&gt;</span></div><div class="line">          <span class="tag">&lt;/<span class="name">configuration</span>&gt;</span>  </div><div class="line">      <span class="tag">&lt;/<span class="name">execution</span>&gt;</span>  </div><div class="line">      <span class="tag">&lt;<span class="name">execution</span>&gt;</span>  </div><div class="line">          <span class="tag">&lt;<span class="name">id</span>&gt;</span>package<span class="tag">&lt;/<span class="name">id</span>&gt;</span>  </div><div class="line">          <span class="tag">&lt;<span class="name">goals</span>&gt;</span>  </div><div class="line">              <span class="tag">&lt;<span class="name">goal</span>&gt;</span>instance-create-archive<span class="tag">&lt;/<span class="name">goal</span>&gt;</span>  </div><div class="line">          <span class="tag">&lt;/<span class="name">goals</span>&gt;</span>  </div><div class="line">      <span class="tag">&lt;/<span class="name">execution</span>&gt;</span>  </div><div class="line">  <span class="tag">&lt;/<span class="name">executions</span>&gt;</span></div><div class="line"><span class="tag">&lt;/<span class="name">plugin</span>&gt;</span></div></pre></td></tr></table></figure></p>
<p>通过此配置，系统在打包时，自动将karaf的standard feature库中的http feature及其依赖和spring feature库中的spring feature及其依赖下载到system目录中一起打包发布。</p>
<h2 id="结论"><a href="#结论" class="headerlink" title="结论"></a>结论</h2><p>通过上述方案，我们即可实现基于Karaf的项目自动打包、测试及发布。</p>

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>


    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/osgi/" rel="tag"># osgi</a>
          
            <a href="/tags/karaf/" rel="tag"># karaf</a>
          
            <a href="/tags/maven/" rel="tag"># maven</a>
          
        </div>
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2015/08/03/java-osgi-dynamic-app-with-karaf-dev/" rel="next" title="Apache Karaf构建动态模块化应用(5)--基于Maven快速搭建Karaf调试环境">
                <i class="fa fa-chevron-left"></i> Apache Karaf构建动态模块化应用(5)--基于Maven快速搭建Karaf调试环境
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2015/08/10/autoit-intro/" rel="prev" title="IT自动化(1)——持续开发，持续集成，持续交付与持续部署">
                IT自动化(1)——持续开发，持续集成，持续交付与持续部署 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
        <div class="ds-share flat" data-thread-key="2015/08/04/java-osgi-dynamic-app-with-karaf-deploy/"
     data-title="Apache Karaf构建动态模块化应用(6)--Karaf离线打包发布"
     data-content=""
     data-url="http://chrisrc.me/2015/08/04/java-osgi-dynamic-app-with-karaf-deploy/">
  <div class="ds-share-inline">
    <ul  class="ds-share-icons-16">

      <li data-toggle="ds-share-icons-more"><a class="ds-more" href="javascript:void(0);">分享到：</a></li>
      <li><a class="ds-weibo" href="javascript:void(0);" data-service="weibo">微博</a></li>
      <li><a class="ds-qzone" href="javascript:void(0);" data-service="qzone">QQ空间</a></li>
      <li><a class="ds-qqt" href="javascript:void(0);" data-service="qqt">腾讯微博</a></li>
      <li><a class="ds-wechat" href="javascript:void(0);" data-service="wechat">微信</a></li>

    </ul>
    <div class="ds-share-icons-more">
    </div>
  </div>
</div>
      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
      <div class="ds-thread" data-thread-key="2015/08/04/java-osgi-dynamic-app-with-karaf-deploy/"
           data-title="Apache Karaf构建动态模块化应用(6)--Karaf离线打包发布" data-url="http://chrisrc.me/2015/08/04/java-osgi-dynamic-app-with-karaf-deploy/">
      </div>
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/images/avatar.gif"
               alt="chrisrc" />
          <p class="site-author-name" itemprop="name">chrisrc</p>
          <p class="site-description motion-element" itemprop="description"></p>
        </div>
        <nav class="site-state motion-element">
          <div class="site-state-item site-state-posts">
            <a href="/archives">
              <span class="site-state-item-count">69</span>
              <span class="site-state-item-name">日志</span>
            </a>
          </div>

          
            <div class="site-state-item site-state-categories">
              <a href="/categories">
                <span class="site-state-item-count">21</span>
                <span class="site-state-item-name">分类</span>
              </a>
            </div>
          

          
            <div class="site-state-item site-state-tags">
              <a href="/tags">
                <span class="site-state-item-count">162</span>
                <span class="site-state-item-name">标签</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/christtrc" target="_blank" title="GitHub">
                  
                    <i class="fa fa-fw fa-github"></i>
                  
                  GitHub
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://twitter.com/chrisrc" target="_blank" title="Twitter">
                  
                    <i class="fa fa-fw fa-twitter"></i>
                  
                  Twitter
                </a>
              </span>
            
          
        </div>

        
        
          <div class="cc-license motion-element" itemprop="license">
            <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" class="cc-opacity" target="_blank">
              <img src="/images/cc-by-nc-sa.svg" alt="Creative Commons" />
            </a>
          </div>
        

        
        

        


      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#概述"><span class="nav-number">1.</span> <span class="nav-text">概述</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Pax-URL-Mvn协议"><span class="nav-number">2.</span> <span class="nav-text">Pax URL Mvn协议</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#协议要点"><span class="nav-number">2.1.</span> <span class="nav-text">协议要点</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#版本范围"><span class="nav-number">2.2.</span> <span class="nav-text">版本范围</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#mvn协议的参数配置"><span class="nav-number">2.3.</span> <span class="nav-text">mvn协议的参数配置</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Maven-Settings配置查找"><span class="nav-number">2.4.</span> <span class="nav-text">Maven Settings配置查找</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Maven本地仓库的查找"><span class="nav-number">2.5.</span> <span class="nav-text">Maven本地仓库的查找</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#远端Maven仓库的解析"><span class="nav-number">2.6.</span> <span class="nav-text">远端Maven仓库的解析</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#设定仓库包含release-snapshot"><span class="nav-number">2.7.</span> <span class="nav-text">设定仓库包含release/snapshot</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#默认仓库"><span class="nav-number">2.8.</span> <span class="nav-text">默认仓库</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Karaf中Maven仓库处理策略的配置"><span class="nav-number">3.</span> <span class="nav-text">Karaf中Maven仓库处理策略的配置</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#默认仓库处理策略"><span class="nav-number">3.1.</span> <span class="nav-text">默认仓库处理策略</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#离线处理策略"><span class="nav-number">3.2.</span> <span class="nav-text">离线处理策略</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#离线依赖自动打包"><span class="nav-number">3.3.</span> <span class="nav-text">离线依赖自动打包</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#结论"><span class="nav-number">4.</span> <span class="nav-text">结论</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy;  2015 - 
  <span itemprop="copyrightYear">2017</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">
     
      <a href="mailto:chrisrc@qq.com">chrisrc</a> 
    
  </span>
  <span class="author"> &nbsp; QQ: 58122705 </span>
</div>


<div class="powered-by">
  由 <a class="theme-link" href="https://hexo.io">Hexo</a> 强力驱动
</div>

<div class="theme-info">
  主题 -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Mist
  </a>
</div>


        

        
      </div>
    </footer>

    <div class="back-to-top">
      <i class="fa fa-arrow-up"></i>
    </div>
  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  



  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.0"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.0"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.0"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.0"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.0"></script>



  

  
    
  

  <script type="text/javascript">
    var duoshuoQuery = {short_name:"chrisrc"};
    (function() {
      var ds = document.createElement('script');
      ds.type = 'text/javascript';ds.async = true;
      ds.id = 'duoshuo-script';
      ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
      ds.charset = 'UTF-8';
      (document.getElementsByTagName('head')[0]
      || document.getElementsByTagName('body')[0]).appendChild(ds);
    })();
  </script>

  
    
    
    <script src="/lib/ua-parser-js/dist/ua-parser.min.js?v=0.7.9"></script>
    <script src="/js/src/hook-duoshuo.js"></script>
  








  
  

  

  

  
<script>
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';        
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>


  
<script>
(function(){
   var src = (document.location.protocol == "http:") ? "http://js.passport.qihucdn.com/11.0.1.js?ed903ab05fbc5fa64d95e4bfbf3d3a04":"https://jspassport.ssl.qhimg.com/11.0.1.js?ed903ab05fbc5fa64d95e4bfbf3d3a04";
   document.write('<script src="' + src + '" id="sozz"><\/script>');
})();
</script>

  


</body>
</html>
